package com.cll.learn.api.dto;

/**
 * 描述信息:
 *
 * @author CLL
 * @version 1.0
 * @date 2020/10/9 13:48
 */
public class AjaxResult<T> {

    private Integer code;

    private String info;

    private T data;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public AjaxResult(Integer code, String info, T data) {
        this.code = code;
        this.info = info;
        this.data = data;
    }

    public AjaxResult(Integer code, String info) {
        this.code = code;
        this.info = info;
    }

    public AjaxResult<T> getSuccess(T data){
        return new AjaxResult<>(200, "操作成功", data);
    }
}
